# requirement of cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

# project name
project(multiThreads-fileRead)

# add source code files to SRC_LIST (添加源码文件)
set(SRC_LIST main.cpp)

configure_file(multiThreads-fileRead-Config.h.in multiThreads-fileRead-Config.h)

# name of executable file and path of source file (指定可执行文件的名称为helloopencv以及源码文件)
add_executable(${PROJECT_NAME} ${SRC_LIST})

target_include_directories(${PROJECT_NAME} 
    PUBLIC 
    "${PROJECT_BINARY_DIR}")

include_directories(
    ${MYSDK_INCLUDE_DIRS}
	${SPDLOG_ROOT}/include
	
	${BOOST_INCLUDE_DIRS}	
)

if (IS_LINUX)
    target_link_libraries(${PROJECT_NAME}
        pthread
        ${MYSDK_LIBRARIES}
        ${BOOST_LIBRARIES}
    )
else()
    target_link_libraries(${PROJECT_NAME}
        ${MYSDK_LIBRARIES}
        ${BOOST_LIBRARIES}
    )
endif()

# 在Windows上
if (IS_WINDOWS)
add_custom_command(
		TARGET
			${PROJECT_NAME}
		POST_BUILD
			COMMAND
				${CMAKE_COMMAND} -E copy_directory $ENV{MYSDK_ROOT}/bin $<TARGET_FILE_DIR:${PROJECT_NAME}>
		VERBATIM
	)
endif()

install(TARGETS ${PROJECT_NAME}
    RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/bin)
